<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    td{
      border: 1px solid black;
      width: 120px;
      height: 120px;
    }
    table{
      border-collapse: collapse;
    }
  </style>
</head>
<body>
  <tr>
    <td></td>
  </tr>
 <table>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
 </table>
 <script src="../jquery-1.12.4.min.js"></script>
 <script>
  // 偶数列变色
  // 每一行单独操作
  $("tr").each(
    function () {
      $(this).children(":odd").css("background-color","red")
    }
  )
  $("td").each(
    function () {
      if ($(this).index() % 2 === 0) {
        $(this).css("background-color","green")
      }
    }
  )
 </script>
</body>
</html>